// index.js
Page({
  data: {
   
    // 应用部分列表参数
    appList: [
      {
        src: "/assets/score.svg",
        title: "成绩查询",
        titleDec: "查询当前及历史成绩",
        color: "green"
      },
      {
        src: "/assets/books.svg",
        title: "图书借阅",
        titleDec: "查看图书借阅记录",
        color: "yellow"
      },{
        src: "/assets/iconfont/money_bag.svg",
        title: "网上查询",
        titleDec: "网上自助缴费",
        color: "blue"
      },{
        src: "/assets/danger.svg",
        title: "学院预警",
        titleDec: "查看学院预警信息",
        color: "red"
      },
    
    ],

    activeIndex: 0,
    titleList:'',

    notice: [
      {
        msg: "关于加强新生入学后校园安全管理规范的通知",
        author: "校园新闻网",
        img: "/assets/item1.png"
      },
      {
        msg: "关于开展2023新生入学教育系列培训课程的指导意见",
        author: "信息化管理中心",
        img: "/assets/item2.png"
      },
    ],

    schoolNews: [
      {
        msg: "关于加强新生入学后校园安全管理规范的通知",
        author: "校园新闻网",
        img: "/assets/item1.png"
      },
      {
        msg: "关于加强新生入学后校园安全管理规范的通知",
        author: "校园新闻网",
        img: "/assets/item1.png"
      }, {
        msg: "关于加强新生入学后校园安全管理条例 实行的通知",
        author: "教务处",
        img: "/assets/item1.png"
      },
      {
        msg: "关于加强新生入学后校园安全管理规范的通知",
        author: "校园新闻网",
        img: "/assets/item1.png"
      },
    ],

    synthesis:[],
    dynamic:[],
  },

  changeTab(e) {
    let index = e.currentTarget.dataset.index;
    let List=[this.data.notice,
      this.data.schoolNews,
      this.data.synthesis,
      this.data.dynamic
    ];
    console.log(index);
    this.setData({
      activeIndex: index,
      titleList:List[index]
    });
  },

    /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.setData({
      titleList:this.data.notice
    })
  },
})



